using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class ATL_ComponentMap : EntityTypeConfiguration<ATL_Component>
    {
        public ATL_ComponentMap()
        {
            // Primary Key
            this.HasKey(t => t.id);

            // Properties
            this.Property(t => t.Component)
                .HasMaxLength(50);

            this.Property(t => t.RecordCode)
                .HasMaxLength(50);

            this.Property(t => t.Dataset)
                .HasMaxLength(50);

            this.Property(t => t.Key)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("ATL_Component");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.Component).HasColumnName("Component");
            this.Property(t => t.RecordCode).HasColumnName("RecordCode");
            this.Property(t => t.Dataset).HasColumnName("Dataset");
            this.Property(t => t.Key).HasColumnName("Key");
        }
    }
}
